loadAd

fun loadAd(adRequest: AdRequest, listener: AppOpenAdLoadListener)

Starts loading the ad on a background thread.

Parameters

adRequest

Data for targeting and ad configuration.

listener

AppOpenAdLoadListener to be invoked when the ad is loaded or loading fails.


suspend fun loadAd(adRequest: AdRequest): <Error class: unknown class>

Starts loading the ad on a background thread. Suspends until the result is available.

Return

AppOpenAdLoadResult.Success with AppOpenAd or AppOpenAdLoadResult.Failure with com.yandex.mobile.ads.common.AdRequestError.

Parameters

adRequest

Data for targeting and ad configuration.


fun loadAd(adUnitId: String, readyResponse: String, listener: AppOpenAdLoadListener)

Starts loading the ad on a background thread with ready response.

Parameters

adUnitId

The AdUnit ID is a unique identifier in the R-M-XXXXXX-Y format, which is assigned in the Partner interface.

readyResponse

Encoded response for ad request.

listener

AppOpenAdLoadListener to be invoked when the ad is loaded or loading fails.


suspend fun loadAd(adUnitId: String, readyResponse: String): <Error class: unknown class>

Starts loading the ad on a background thread with ready response. Suspends until the result is available.

Return

AppOpenAdLoadResult.Success with AppOpenAd or AppOpenAdLoadResult.Failure with com.yandex.mobile.ads.common.AdRequestError.

Parameters

adUnitId

The AdUnit ID is a unique identifier in the R-M-XXXXXX-Y format, which is assigned in the Partner interface.

readyResponse

Encoded response for ad request.